<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:body>
	<h:form id="frm_groups" rendered="#{registeredUser.hasCategoryPrivilege(1)}">
		<p:panel header="#{msgs.Administration_Group_GroupList}">
			<p:dataTable id="tb1_groupsList" value="#{groupBean.groupsList}"
				var="group" paginator="true" rows="25">
				<p:column headerText="#{msgs.Administration_Group_GroupId}" style="font-size: smaller">
					<h:outputText value="#{group.recid}" />
				</p:column>

				<p:column headerText="#{msgs.Administration_Group_GroupName}" style="font-size: smaller">
					<h:outputText value="#{group.name}" />
				</p:column>
				
				<p:column headerText="#{msgs.Administration_General_Options}"
					style="font-size: smaller;text-align: center;width:100px">

					<p:commandButton action="#{groupBean.toEditGroup}"
						onstart="waiteDialog.show();" style="width: 30px;height: 30px"
						image="ui-icon ui-icon-pencil" title="Edit"
						rendered="#{registeredUser.hasPrivilege(2)}">
						<f:setPropertyActionListener value="#{group}"
							target="#{groupBean.group}" />
					</p:commandButton>
					<p:spacer width="10" />

					<p:commandButton action="#{groupBean.deleteGroupWithPrivileges}" 
						onstart="waiteDialog.show();" oncomplete="waiteDialog.hide();"
						update="@form" style="width: 30px;height: 30px"
						image="ui-icon ui-icon-trash" title="Delete"
						rendered="#{registeredUser.hasPrivilege(3)}">
						<f:setPropertyActionListener value="#{group}"
							target="#{groupBean.group}" />
					</p:commandButton>
					
				</p:column>

			</p:dataTable>

			<p:messages id="msgs" showDetail="true" showSummary="true" />
		</p:panel>

	</h:form>

</h:body>
</html>

